/*
 * @Author: TANGB02 13233582+Ace-Tang@user.noreply.gitee.com
 * @Date: 2024-02-28 09:43:26
 * @LastEditors: TANGB02 13233582+Ace-Tang@user.noreply.gitee.com
 * @LastEditTime: 2024-02-28 16:21:48
 * @FilePath: \ycq\ycq\ycq1.0\src\utils\statusManage.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */

import { ref } from "vue";

import LocalCatch from "@/utils/token.js";
// 登录变量--false:未登录 登录:true --> user:用户登录 admin:管理员登录(localCatch:roles)
const isLogin = ref(!!LocalCatch.getToken("token")); //登录：true

const getIsLogin = () => isLogin.value;
const setIsLogin = (value) => (isLogin.value = value);

export default function useLogin() {
  return {
    isLogin: isLogin.value,
    getIsLogin,
    setIsLogin,
  };
}
